extends common/layout
block content
    link(rel='stylesheet' type='text/css' href='../css/login.min.css')
    div.login-container
        div.header
            img.icon-logo(src="../image/icon_logo.png")
        div.content
            div.login-bg
            div.login-content
                img(src="../image/login_bg.png")
                div.login-box-warp
                    div.login-title
                        p 账号登录
                    div.login-box
                        form(id="login")
                            div.field
                                i.icon.icon-zhanghao
                                input(type="nickname" name="username" placeholder="账号" required)
                            div.field
                                i.icon.icon-mima
                                input(type="password" name="password" placeholder="密码" required)
                            div.verification-code
                                input.code_input(type="text" name="codenum" placeholder="请输入验证码" required)
                                div.code(id="code-container")
                                div.btn-change 换一换
                            button.btn-login 登录

    script(src="../js/gVerify.js")
    script.
        var verifyCode = new GVerify("code-container");
        $(".btn-change").click(function () {
            verifyCode.refresh();
        })
        $(".btn-login").click(function () {
            var res = verifyCode.validate($(".code_input").val());
            if (res) {
                alert("验证正确");
            } else {
                alert("验证码错误");
            }
        })
        $("#login").validate();



